Skip to content

Conversation

@t0ngk
Copy link
Collaborator

@t0ngk t0ngk commented Aug 26, 2025

Why did you create this PR

Some collection don't want to have select checkbox or bulk delete

What did you do

  • add action named select

Screenshots / Recordings

Select: false

CleanShot 2568-08-26 at 13 07 20@2x

Select: true

CleanShot 2568-08-26 at 13 08 16@2x

Checklist

  • Self-reviewed your code
  • Wrote coverage tests
  • Added screenshots or recordings if applicable

@changeset-bot
Copy link

changeset-bot bot commented Aug 26, 2025

🦋 Changeset detected

Latest commit: 5aa9e5c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@example/erp Patch
@genseki/react Patch
@example/ui-playground Patch
@genseki/next Patch
@genseki/plugins Patch
@genseki/prisma-generator Patch
@genseki/react-query Patch
@genseki/rest Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

const columnHelper = createColumnHelper<BaseData>()
return [
...(listViewProps.actions?.delete
...(listViewProps.actions?.select
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it mean delete will not be usable if select is not turned on.

Suggested change
...(listViewProps.actions?.select
...((listViewProps.actions?.select || listViewProps.actions?.delete)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no delete still useable in action dropdown this action is only for disable select action

loadingItems={pagination.pageSize}
className="static"
onRowClick="toggleSelect"
onRowClick={listViewProps.actions?.select ? 'toggleSelect' : undefined}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as previous comment

Suggested change
onRowClick={listViewProps.actions?.select ? 'toggleSelect' : undefined}
onRowClick={(listViewProps.actions?.select || listViewProps.actions?.delete) ? 'toggleSelect' : undefined}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as previous

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please provide an example for the select flag?

Copy link
Member

@saenyakorn saenyakorn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

About this: the current approach removes select and actions from columns.

Instead, we provide helper functions to create select and actions.

Users can use the helper functions like this:

const columns = [
  selectColumn(),
  columnHelper.access(...),
  columnHelper.display({ ... }),
  actionsColumn({
    view: true,
    delete: true,
  }),
]

Note: The design is not final yet. Feel free to improve it.

@t0ngk t0ngk merged commit 89e2a38 into main Sep 10, 2025
1 check passed
@t0ngk t0ngk deleted the tong/feat/action-select branch September 10, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants